import { appPort } from './config/setting.js'
import Koa from 'koa'
import { useController } from './router/index.js'
import {sync} from "./db/index.js"

await sync()


//创建Koa实例
const app = new Koa()
// const router = new Router()
//引入自己封装的控制器系统，测试可用，让app.js 入口更干净整洁
useController(app);

//监听
app.listen(appPort)

//打印服务运行地址：loaclhost
console.log(`后端服务运行于：http://localhost:${appPort}`);
